
execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:0b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:0b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:0b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 0

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:1b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:1b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:1b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 1

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:2b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:2b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:2b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 2

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:3b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:3b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:3b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 3

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:4b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:4b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:4b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 4

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:5b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:5b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:5b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 5

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:6b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:6b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:6b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 6

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:7b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:7b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:7b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 7

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:8b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:8b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:8b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 8

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:9b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:9b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:9b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 9

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:10b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:10b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:10b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 10

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:11b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:11b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:11b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 11

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:12b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:12b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:12b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 12

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:13b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:13b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:13b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 13

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:14b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:14b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:14b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 14

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:15b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:15b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:15b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 15

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:16b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:16b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:16b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 16

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:17b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:17b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:17b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 17

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:18b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:18b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:18b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 18

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:19b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:19b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:19b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 19

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:20b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:20b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:20b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 20

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:21b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:21b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:21b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 21

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:22b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:22b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:22b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 22

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:23b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:23b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:23b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 23

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:24b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:24b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:24b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 24

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:25b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:25b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:25b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 25

execute at @s if score @s advm_battery_swapper_available matches -1 if data block ~ ~ ~ Items[{Slot:26b}].tag.battery store result score @s advm_battery_swapper_temp1 run data get block ~ ~ ~ Items[{Slot:26b}].tag.battery
execute at @s if score @s advm_battery_swapper_temp1 matches 1 if data block ~ ~ ~ Items[{Slot:26b}].tag.battery run scoreboard players set @s advm_battery_swapper_available 26


execute at @s if score @s advm_battery_swapper_available matches 0 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:0b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 1 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:1b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 2 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:2b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 3 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:3b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 4 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:4b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 5 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:5b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 6 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:6b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 7 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:7b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 8 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:8b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 9 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:9b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 10 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:10b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 11 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:11b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 12 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:12b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 13 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:13b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 14 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:14b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 15 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:15b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 16 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:16b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 17 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:17b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 18 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:18b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 19 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:19b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 20 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:20b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 21 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:21b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 22 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:22b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 23 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:23b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 24 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:24b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 25 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:25b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 26 store result score @s advm_power run data get block ~ ~ ~ Items[{Slot:26b}].tag.power


execute at @s if score @s advm_battery_swapper_available matches 0 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:0b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 0 run loot replace block ~ ~ ~ container.0 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 0 run item modify block ~ ~ ~ container.0 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 1 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:1b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 1 run loot replace block ~ ~ ~ container.1 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 1 run item modify block ~ ~ ~ container.1 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 2 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:2b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 2 run loot replace block ~ ~ ~ container.2 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 2 run item modify block ~ ~ ~ container.2 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 3 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:3b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 3 run loot replace block ~ ~ ~ container.3 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 3 run item modify block ~ ~ ~ container.3 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 4 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:4b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 4 run loot replace block ~ ~ ~ container.4 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 4 run item modify block ~ ~ ~ container.4 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 5 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:5b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 5 run loot replace block ~ ~ ~ container.5 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 5 run item modify block ~ ~ ~ container.5 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 6 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:6b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 6 run loot replace block ~ ~ ~ container.6 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 6 run item modify block ~ ~ ~ container.6 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 7 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:7b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 7 run loot replace block ~ ~ ~ container.7 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 7 run item modify block ~ ~ ~ container.7 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 8 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:8b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 8 run loot replace block ~ ~ ~ container.8 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 8 run item modify block ~ ~ ~ container.8 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 9 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:9b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 9 run loot replace block ~ ~ ~ container.9 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 9 run item modify block ~ ~ ~ container.9 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 10 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:10b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 10 run loot replace block ~ ~ ~ container.10 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 10 run item modify block ~ ~ ~ container.10 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 11 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:11b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 11 run loot replace block ~ ~ ~ container.11 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 11 run item modify block ~ ~ ~ container.11 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 12 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:12b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 12 run loot replace block ~ ~ ~ container.12 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 12 run item modify block ~ ~ ~ container.12 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 13 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:13b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 13 run loot replace block ~ ~ ~ container.13 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 13 run item modify block ~ ~ ~ container.13 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 14 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:14b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 14 run loot replace block ~ ~ ~ container.14 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 14 run item modify block ~ ~ ~ container.14 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 15 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:15b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 15 run loot replace block ~ ~ ~ container.15 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 15 run item modify block ~ ~ ~ container.15 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 16 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:16b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 16 run loot replace block ~ ~ ~ container.16 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 16 run item modify block ~ ~ ~ container.16 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 17 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:17b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 17 run loot replace block ~ ~ ~ container.17 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 17 run item modify block ~ ~ ~ container.17 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 18 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:18b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 18 run loot replace block ~ ~ ~ container.18 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 18 run item modify block ~ ~ ~ container.18 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 19 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:19b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 19 run loot replace block ~ ~ ~ container.19 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 19 run item modify block ~ ~ ~ container.19 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 20 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:20b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 20 run loot replace block ~ ~ ~ container.20 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 20 run item modify block ~ ~ ~ container.20 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 21 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:21b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 21 run loot replace block ~ ~ ~ container.21 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 21 run item modify block ~ ~ ~ container.21 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 22 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:22b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 22 run loot replace block ~ ~ ~ container.22 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 22 run item modify block ~ ~ ~ container.22 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 23 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:23b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 23 run loot replace block ~ ~ ~ container.23 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 23 run item modify block ~ ~ ~ container.23 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 24 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:24b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 24 run loot replace block ~ ~ ~ container.24 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 24 run item modify block ~ ~ ~ container.24 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 25 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:25b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 25 run loot replace block ~ ~ ~ container.25 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 25 run item modify block ~ ~ ~ container.25 advm:set_amount

execute at @s if score @s advm_battery_swapper_available matches 26 store result score @s advm_chargeable run data get block ~ ~ ~ Items[{Slot:26b}].tag.chargeable
execute if score @s advm_chargeable matches 0 if score @s advm_battery_swapper_available matches 26 run loot replace block ~ ~ ~ container.26 loot advm:battery_used_up
data modify storage advm:temp amount set value 0
execute if score @s advm_chargeable matches 1 if score @s advm_battery_swapper_available matches 26 run item modify block ~ ~ ~ container.26 advm:set_amount
scoreboard players set @s advm_battery_swapper_available -1

